#pragma once
#include "DUtility.h"
#include "DAabb.h"
#include "DVector3.h"
#include "DMatrix3.h"
#include "Geometries/DGeometry.h"

namespace Skill
{
	namespace Ode
	{		
		void DUtility::ClosestLineSegmentPoints (DVector3^ a1, DVector3^ a2,
				DVector3^ b1, DVector3^ b2,
				DVector3^ cp1, DVector3^ cp2)
		{
			dClosestLineSegmentPoints(a1->_This, a2->_This,
				b1->_This, b2->_This,
				cp1->_This, cp2->_This);
		}

		bool DUtility::BoxTouchesBox(DVector3^ _p1,  DMatrix3^ R1,
					DVector3^ side1, DVector3^ _p2,
					DMatrix3^ R2, DVector3^ side2)
		{
			return dBoxTouchesBox(_p1->_This,  R1->_This,
					side1->_This, _p2->_This,
					R2->_This, side2->_This) == 1;
		}

		void DUtility::InfiniteAABB(DGeometry^ geom, DAabb^ aabb)
		{
			dInfiniteAABB(geom->_Geom(), aabb->_This);
		}
	}
}